home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ARASAN_S.ZIP / BOOK.H < prev    next >
C/C++ Source or Header  |  1993-11-19  |  1KB  |  46 lines

  1. // Copyright 1992-3 by Jon Dart.  All Rights Reserved.
  2.  
  3. #ifndef _BOOK_H
  4. #define _BOOK_H
  5.  
  6. #include "bookread.h"
  7. #include "log.h"
  8.  
  9. class Book
  10. {
  11.     // interface to the opening book.
  12.  
  13.     public:
  14.         
  15.     Book();
  16.     
  17.     ~Book();
  18.         
  19.     Move book_move( const Board &b );
  20.     // Returns a "book move" if there is one, NullMove otherwise.
  21.     // NOTE: the promotion field of book_move may be wrong;
  22.         // we don't set it.
  23.         
  24.         unsigned book_moves( const Board &b, Move *moves, 
  25.         const unsigned limit);
  26.         // Fills array "moves" with a list of all the book moves for
  27.         // the given position.  Moves are sorted in decreasing order
  28.         // of "goodness".  Moves that are not recommended at all are
  29.         // are not included.  "limit" is the maximum number of moves
  30.         // that can be stored in "moves".  The return value is the
  31.         // number actually stored.        
  32.         
  33.     private:
  34.         
  35.     Boolean find_move( const Move &target, unsigned &node);
  36.     
  37.     Move pick( const Board &b, uint16 node_index,
  38.          const Book_Entry &node );
  39.     
  40.         Book_Reader *bookw;
  41.     Book_Reader *bookb;
  42. };
  43.  
  44. #endif
  45.  
  46.